<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="button" value="按钮" onclick="f1()">
<script>
  /*无参无返回值*/
  function f1() {
    console.log("f")
  }
  //调用
  f1();
  //有参无返回值
  function f2(name ,age) {
    console.log(name+":"+age)
  }
  f2("sun",500);
  //无参有返回值
  function f3() {
    return "woshisss"
  }
  let s=f3();
  console.log(s);
  //有参有返回值
  function f4(x,y) {
    return x*y;
  }
  let ss=f4(5,9);
  console.log(ss);
  //第二种声明方法的方式
  let f5 = function (name , age) {
    console.log(name+":"+age )
  }
  f5("sunnnn",21);
  let f6 =new Function("name","age","console.log(name+':'+age)" );
  f6("sssss",70)
</script>
</body>
</html>